<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link rel="icon" href="favicon.ico" type="image/x-icon"/>
        <title>用户分组管理-微信管理-{$site.BACK_NAME}</title>
        <include file="Public:jscss" />
    </head>
    <body>
        <div class="wrap">
            <include file="Public:head" />
            <div class="mainBody">
                <include file="Public:left" />
                <div id="Right">
                    <div class="Item hr">
                        <div class="current">用户分组管理</div>
                    </div>
                    <form action="" method="post" id="quickForm">
                        <b>添加分组：</b>
                        <input type="hidden" name="act" value="add" /> &nbsp;
                        &nbsp;
                        <input placeholder="你要添加的分组名称" id="newName" class="input" type="text" name="name" value="" /> &nbsp;
                        <button class="btn quickSubmit">确定添加</button>
                    </form>
                    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tab">
                        <thead>
                            <tr align="center">
                                <td width="10%">分组ID</td>
                                <td width="20%">原分组名称</td>
								<td width="20%">用户数量</td>
                                <td width="20%" align="left">操作属性</td>
                                <td width="20%">修改后名称</td>
                                <td width="10%">操作</td>
                            </tr>
                        </thead>
                        <tbody>
                            <volist name="list" id="tree">
							<tr cid="{$tree.id}">
								<td align="center">
									{$tree.id}
									<input type="hidden" name="gid" value="{$tree.id}"/>
								</td>
								<td>
									{$tree.name}
									<input type="hidden" name="yname" value="{$tree.name}"/>
								</td>
								<td>{$tree.count}</td>
								<td>
									<select name="act" class="act">
										<option selected="selected" value="edt">修改该分组</option>
										<option value="del">删除该分组</option>
									</select>
								</td>
								<td><input type="text" value="" name="name" class="input" placeholder="你要修改分组的新名称"/></td>
								<td align="center"><button class="btn opCat">确定</button></td>
							</tr>
                            </volist>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <form action="" method="post" id="opForm">
            <input id="id" type="hidden" name="id" />
            <input id="act" type="hidden" name="act" />
            <input id="name" type="hidden" name="name" />
        </form>
        <div class="clear"></div>
        <include file="Public:foot" />
    </body>
<script type="text/javascript">
$(function(){
	$(".opCat").click(function(){
	var obj=$(this).parents("tr");
	$("#id").val(obj.find("input[name='gid']").val());
	$("#act").val(obj.find("select[name='act']").val());
	$("#name").val(obj.find("input[name='name']").val());
	if($("#act").val()=="del"){
		$.jBox.confirm(
			'您真的打算删除【<b>'+obj.find("input[name='yname']").val()+'</b>】分组吗?',
			"温馨提示",
			function(v, h, f) {
				if (v == true) {
					commonAjaxSubmit("","#opForm");
				}
			},
			{buttons: {'是': true, '否': false}}
		);
		return false;
	}
	commonAjaxSubmit("","#opForm");
	});
	$(".quickSubmit").click(function(){
		if($("#newName").val()==''){
			$.jBox.tip('分组名称不能为空', 'info');
			return false;
		}
		commonAjaxSubmit("","#quickForm");
		return false;
	});
});
</script>
</html>